/**
 * ...
 * @author Franco Ponticelli
 */

package uform.ui.comp;

import uform.ui.comp.Component;
import uform.property.IProperty;

class Container extends Component
{
	public function remove(o : Component) : Bool
	{
		if (null == o || o.parent.get() != this)
			return false;
		var c : { private var _parent : IProperty<Container>; } = o;
		c._parent.set(null);
		return true;
	}
	
	function _parentFor(o : Component)
	{
		if (null == o || o.parent.get() == this)
			return false;
		var c : { private var _parent : IProperty<Container>; } = o;
		c._parent.set(this);
		return true;
	}
	
	public function componentByPath(path : String) : INamedComponent {
		return throw "abstract method componentByPath";
	}
	
	public function componentByName(name : String) : INamedComponent {
		return throw "abstract method componentByPath";
	}
}